package com.example.demo.myBatisMapper;

import com.example.demo.controller.FriendRequestResponse;
import com.example.demo.model.FriendRequest;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface FriendRequestMapper {
    //插入一条好友请求
    int addFriendRequest(FriendRequest friendRequest);

    //用来查询添加的好友是否已经存在
    List<Integer> selectForFriend(int userId, int friendId);

    //用来判断好友请求是否已经发送了
    FriendRequest selectFriendRequest(int userId, int toUserId);

    //删除一条请求
    void deleteRequest(int fromId,int toUserId);

    //查询历史请求
    List<FriendRequestResponse> getHistoryRequest(int toUserId);
}
